class CommentsController < ApplicationController
    before_action :authenticate_user!
    def create
        @good = Good.find_by_id(params[:good_id])
        @comment = @good.comments.new()
        @comment.content = params.require(:comment)[:content]
        @comment.username = current_user.username
        @comment.save
        redirect_to good_path(@good)
    end
end

